#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

void bubble_sort(int* a, int len)
{
	int flag = 0;
	for (int i = 0; i < len; i++)
	{
		for (int j = 0; j < len - 1 - i; j++)
		{
			if (a[j] < a[j + 1])
			{
				flag = 1;
				int temp = a[j];
				a[j] = a[j + 1];
				a[j + 1] = temp;
			}
		}
		if (flag == 0)
			return;
	}
}

int main()
{
	int arr[] = { 1,22,44,56,88,0,20 };
	int len = sizeof(arr) / sizeof(int);
	bubble_sort(arr, len);
	for (int i = 0; i < len; i++)
	{
		printf("%d ", arr[i]);
	}

	return 0;
}